﻿
<div class="top_bar">
    @Session["isim"] <br />
    @Session["email"]
    <div class="top_search">
        <div class="search_text"><a href="http://www.free-css.com/">Advanced Search</a></div>
        <input type="text" id="search"  class="search_input" name="search" />
        <input type="image" src="~/Contents/themes/base/images/search.gif" class="search_bt" />
        <br />
        <div id="dv" style="width:200px; height:auto; background-color:white"> <ul id="sul"></ul></div>
    </div>
    <div class="languages">
        <div class="lang_text">Languages:</div>
        <a href="http://www.free-css.com/" class="lang"><img src="~/Contents/themes/base/images/en.gif" alt="" border="0" /></a> <a href="http://www.free-css.com/" class="lang"><img src="~/Contents/themes/base/images/de.gif" alt="" border="0" /></a>
    </div>
</div>

<div id="header">
    <div id="logo"> <a href="http://www.free-css.com/"><img src="~/Contents/themes/base/images/logo.png" alt="" border="0" width="237" height="140" /></a> </div>
    <div class="oferte_content">
        <div class="top_divider"><img src="~/Contents/themes/base/images/header_divider.png" alt="" width="1" height="164" /></div>
        <div class="oferta">
            <div class="oferta_content">
                <img src="~/Contents/themes/base/images/laptop.png" width="94" height="92" alt="" border="0" class="oferta_img" />
                <div class="oferta_details">
                    <div class="oferta_title">Samsung GX 2004 LM</div>
                    <div class="oferta_text"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco </div>
                    <a href="details.html" class="details">details</a>
                </div>
            </div>
            <div class="oferta_pagination"> <span class="current">1</span> <a href="http://www.free-css.com/">2</a> <a href="http://www.free-css.com/">3</a> <a href="http://www.free-css.com/">4</a> <a href="http://www.free-css.com/">5</a> </div>
        </div>
        <div class="top_divider"><img src="~/Contents/themes/base/images/header_divider.png" alt="" width="1" height="164" /></div>
    </div>
    <!-- end of oferte_content-->
</div>


<script>
    $("#search").keyup(function () {
     //   alert("ajax");
        var id = $("#search").val()

        if (id != "") {

        


        $.ajax({                  //controllerda metod parametre alıyor , int id , şeklinde
            url: '/Home/urunlerstring/' + id,
            type: 'POST',
            ContentType: "application/json;charset=UTF-8",
            success: function (result) {
                //  alert(result)


                $("#sul").remove()
                $("#dv").append("<ul id='sul'>")
                $.each(result, function (key, value) {
                    $("#sul").append("<li>" + value.urunadi + "</li>")
                })
           
            }
        })
        } // if









        else {
            $("#sul").remove()
        }

    })
</script>

